if (!require(tidyverse))
install.packages("tidyverse")
Loading required package: tidyverse
Registered S3 methods overwritten by 'dbplyr':
method from
print.tbl_lazy
print.tbl_sql
── Attaching packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.1 ──
✓ ggplot2 3.3.3 ✓ purrr 0.3.4
✓ tibble 3.1.2 ✓ dplyr 1.0.6
✓ tidyr 1.1.3 ✓ stringr 1.4.0
✓ readr 1.4.0 ✓ forcats 0.5.1
── Conflicts ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
library(tidyverse)
if (!require(viridis))
install.packages("viridis")
Loading required package: viridis
Loading required package: viridisLite
library(viridis)
if (!require(gh))
install.packages("gh")
Loading required package: gh
library(gh)
if (!require(jsonlite))
install.packages("jsonlite")
Loading required package: jsonlite
Attaching package: ‘jsonlite’
The following object is masked from ‘package:purrr’:
flatten
library(jsonlite)
if (!require(DT))
install.packages('DT')
Loading required package: DT
Registered S3 method overwritten by 'htmlwidgets':
method from
print.htmlwidget tools:rstudio
library(DT)
Set ghToken GitHub personal access token with public access in order to authenticate with their API.
ghToken <- 'ghp_XXX'
ghAuth <- function(...) {
gh(..., .token=ghToken)
}
ghAllPages <- function(...) {
result <- list()
i <- 0
repeat {
i <- i + 1
newElements <- NA
tryCatch({
newElements <- ghAuth(..., per_page=100, page=i)
}, error=function(e) {
if (is(e, 'http_error_404') & i == 1) return(NA)
else return(e)
})
if (anyNA(newElements)) return(NA)
result <- append(result, newElements)
if (length(newElements) < 100) return(result)
}
}
repo_urls <- read.csv2('./dataset.csv') %>% transmute(repoUrl = Project.URLs)
repo_urls